{% if versions %}

<!-- Start of versioning -->

<div class="sidebar-tree">
    <p class="caption" role="heading">
        <span class="caption-text">{{ _('Versions') }}</span>
    </p>
    <ul>
        <li class="toctree-l1">
            <a
                id="version_number"
                class="reference internal"
                href="{{ DOCS_SITE_URL }}"
                >stable</a
            >
        </li>
        <li class="toctree-l1">
            <a
                id="commit_hash"
                class="reference internal"
                href="{{DOCS_SITE_URL}}master/"
                >developer</a
            >
        </li>
        {% for version in RELEASE_VERSIONS %}
        <li class="toctree-l1">
            <a
                id="{{ version }}"
                class="reference internal"
                href="{{DOCS_SITE_URL}}{{version}}/"
                >{{version}}</a
            >
        </li>
        {% endfor %}
    </ul>
</div>

<br>
<br>

<script
    type="text/javascript"
    src="{{ DOCS_SITE_URL }}versioning.js"
></script>

<script type="text/javascript">
    window.addEventListener("load", () => {
        const version_number = Version.version_number;
        const commit_hash = Version.commit_hash;

        document.getElementById("version_number").innerHTML =
            "stable <code class='docutils literal notranslate'><span class='pre'> (" +
            version_number +
            ")</span></code>";
        document.getElementById("commit_hash").innerHTML =
            "master <code class='docutils literal notranslate'><span class='pre'> (" +
            commit_hash.slice(0, 7) +
            "&hellip;)</span></code>";
    });
</script>

<!-- End of versioning -->

{% endif %}
